package Springboot.config;

import Springboot.Inceptor.loginInceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import Springboot.Inceptor.loginInceptor;
/**
 * 添加配置类，让拦截器之拦截跟新闻的增删改相关的操作
 * 添加路径
 * */
@Configuration
public class webmvcconfig implements WebMvcConfigurer {
    @Autowired
    private loginInceptor loginInceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInceptor).addPathPatterns("/headline/**");
    }
}
